<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-商品列表">
</@frame.head>
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/search_table.css" />
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 后台管理中心 <span class="c-gray en">&gt;</span>特约商户 <span class="c-gray en">&gt;</span> 焦点图新增 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
<form method="post" name="save_form"  id="save_form" action="${contextPath}/movePic/movePic_save" >                            
    <div class="text-c">
        <table class="table search_table">
        <tr>
	        	<input type="file" id="moveImage" name="moveImage" onchange="getFullPath(this);" />
				<div id="newPreview">
					<img id="images" width="355" height="220" style="clear:both; display:block; padding-left: 73px;" />
				</div>
	        </tr>
	     <tr style="height: 50px;">
	        	<td>
	        	<label class="form-label col-xs-4 col-sm-2">
				<span class="c-red">*</span>
				图片链接地址：</label>
	        	
	        <div class="formControls col-xs-6 col-sm-6">
				<input class="input-text" type="text" id="picUrl" name="picUrl" size="80px;"/>
			</div>
	        	
	        	</td>
	     </tr>

	     <tr>
	     <td>
	    		<div class="row cl">
			<div class="col-9 col-offset-2">
				<input class="btn btn-primary radius" type="button" onclick="save();"  value="&nbsp;&nbsp;增加&nbsp;&nbsp;">
			</div>
		</div>
		</td>
		</tr>
      	</table>
    </div>
</form>
    <div id="biuuu_city" style="padding-top: 10px;float: right"></div>
</div>
<@frame.end "default">
</@frame.end>

<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/laypage/laypage.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/order/search_order_list.js"></script>
<script type="text/javascript">
var path="${contextPath}";

		   //图片尺寸读取
		function getFullPath(obj) {
		     var isImag = picIsRule(obj.value,true);
		     if(isImag){}else{
					return false;
			     }				
		  var o = {};
		  //alert(window.navigator.userAgent);
		  if(obj) {
			   if (window.navigator.userAgent.indexOf("MSIE") >= 1) {
					  var imgserver = document.getElementById("images");
	              imgserver.style.display = 'none';			      
			       var newPreview = document.getElementById("newPreview");		
			       obj.select();	
			       o.filename = document.selection.createRange().text;
		            newPreview.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = o.filename;
		            newPreview.style.width = "149px";
		            newPreview.style.height = "128px";	
			    } else if (window.navigator.userAgent.indexOf("Firefox") >= 1 && obj.files) {
			      // firefox
			      o.filename = window.URL.createObjectURL(obj.files.item(0));
			 	  document.getElementById("images").src=o.filename;	        
			    } else {
			      o.filename = obj.value;
				  document.getElementById("images").src=o.filename;
			    }
		  		return o;
		  }
		}

		function save(){
			
			if($("#moveImage").val()==''){
				alert("请选择焦点图!");
				return;
			}
			
			if($("#picUrl").val()==''){
				alert("请输入焦点图链接地址!");
				return;
			}
			
		    $("#save_form").ajaxSubmit({
				dataType : 'html',
		        success: function(message){
		        		if(message == "200"){
		                    layer.msg('操作成功!',{icon:1,time:1000},function(){
		                        parent.window.location.reload();
		                    });
		 				}else if(message == "500"){
		 					layer.alert("系统繁忙！");
		 				}else{
		 					layer.alert(message);
		 				}
		        },
		        error: function(){
		            layer.msg('操作失败!',{icon:5,time:1000});
		        }
		    });
		}
</script>
</body>

</html>
 
